home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  4.7 KB  |  206 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CommResources.h
  3.  
  4.      Contains:    Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1988-1993, 1995-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COMMRESOURCES__
  18. #define __COMMRESOURCES__
  19.  
  20. #ifndef __OSUTILS__
  21.     #include <OSUtils.h>
  22. #endif
  23.  
  24. #ifndef __CONDITIONALMACROS__
  25.     #include <ConditionalMacros.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51. #if CALL_NOT_IN_CARBON
  52. enum {
  53.                                                                 /*    tool classes (also the tool file types)    */
  54.     classCM                        = FOUR_CHAR_CODE('cbnd'),
  55.     classFT                        = FOUR_CHAR_CODE('fbnd'),
  56.     classTM                        = FOUR_CHAR_CODE('tbnd')
  57. };
  58.  
  59. enum {
  60.                                                                 /*    version of the Comm Resource Manager    */
  61.     curCRMVersion                = 2,                            /* constants general to the use of the Communications Resource Manager */
  62.     crmType                        = 9,                            /* queue type    */
  63.     crmRecVersion                = 1,                            /* version of queue structure */
  64.                                                                 /*    error codes */
  65.     crmGenericError                = -1,
  66.     crmNoErr                    = 0
  67. };
  68.  
  69. /* data structures general to the use of the Communications Resource Manager */
  70. typedef OSErr                             CRMErr;
  71.  
  72. struct CRMRec {
  73.     QElemPtr                         qLink;                        /*reserved*/
  74.     short                             qType;                        /*queue type -- ORD(crmType) = 9*/
  75.     short                             crmVersion;                    /*version of queue element data structure*/
  76.     long                             crmPrivate;                    /*reserved*/
  77.     short                             crmReserved;                /*reserved*/
  78.     long                             crmDeviceType;                /*type of device, assigned by DTS*/
  79.     long                             crmDeviceID;                /*device ID; assigned when CRMInstall is called*/
  80.     long                             crmAttributes;                /*pointer to attribute block*/
  81.     long                             crmStatus;                    /*status variable - device specific*/
  82.     long                             crmRefCon;                    /*for device private use*/
  83. };
  84. typedef struct CRMRec                    CRMRec;
  85. typedef CRMRec *                        CRMRecPtr;
  86. EXTERN_API( CRMErr )
  87. InitCRM                            (void);
  88.  
  89. EXTERN_API( QHdrPtr )
  90. CRMGetHeader                    (void);
  91.  
  92. EXTERN_API( void )
  93. CRMInstall                        (CRMRecPtr                 crmReqPtr);
  94.  
  95. EXTERN_API( OSErr )
  96. CRMRemove                        (CRMRecPtr                 crmReqPtr);
  97.  
  98. EXTERN_API( CRMRecPtr )
  99. CRMSearch                        (CRMRecPtr                 crmReqPtr);
  100.  
  101. EXTERN_API( short )
  102. CRMGetCRMVersion                (void);
  103.  
  104. EXTERN_API( Handle )
  105. CRMGetResource                    (ResType                 theType,
  106.                                  short                     theID);
  107.  
  108. EXTERN_API( Handle )
  109. CRMGet1Resource                    (ResType                 theType,
  110.                                  short                     theID);
  111.  
  112. EXTERN_API( Handle )
  113. CRMGetIndResource                (ResType                 theType,
  114.                                  short                     index);
  115.  
  116. EXTERN_API( Handle )
  117. CRMGet1IndResource                (ResType                 theType,
  118.                                  short                     index);
  119.  
  120. EXTERN_API( Handle )
  121. CRMGetNamedResource                (ResType                 theType,
  122.                                  ConstStr255Param         name);
  123.  
  124. EXTERN_API( Handle )
  125. CRMGet1NamedResource            (ResType                 theType,
  126.                                  ConstStr255Param         name);
  127.  
  128. EXTERN_API( void )
  129. CRMReleaseResource                (Handle                 theHandle);
  130.  
  131. EXTERN_API( Handle )
  132. CRMGetToolResource                (short                     procID,
  133.                                  ResType                 theType,
  134.                                  short                     theID);
  135.  
  136. EXTERN_API( Handle )
  137. CRMGetToolNamedResource            (short                     procID,
  138.                                  ResType                 theType,
  139.                                  ConstStr255Param         name);
  140.  
  141. EXTERN_API( void )
  142. CRMReleaseToolResource            (short                     procID,
  143.                                  Handle                 theHandle);
  144.  
  145. EXTERN_API( long )
  146. CRMGetIndex                        (Handle                 theHandle);
  147.  
  148. EXTERN_API( short )
  149. CRMLocalToRealID                (ResType                 bundleType,
  150.                                  short                     toolID,
  151.                                  ResType                 theType,
  152.                                  short                     localID);
  153.  
  154. EXTERN_API( short )
  155. CRMRealToLocalID                (ResType                 bundleType,
  156.                                  short                     toolID,
  157.                                  ResType                 theType,
  158.                                  short                     realID);
  159.  
  160. EXTERN_API( OSErr )
  161. CRMGetIndToolName                (OSType                 bundleType,
  162.                                  short                     index,
  163.                                  Str255                 toolName);
  164.  
  165. EXTERN_API( OSErr )
  166. CRMFindCommunications            (short *                vRefNum,
  167.                                  long *                    dirID);
  168.  
  169. EXTERN_API( Boolean )
  170. CRMIsDriverOpen                    (ConstStr255Param         driverName);
  171.  
  172. EXTERN_API( CRMErr )
  173. CRMParseCAPSResource            (Handle                 theHandle,
  174.                                  ResType                 selector,
  175.                                  unsigned long *        value);
  176.  
  177. EXTERN_API( OSErr )
  178. CRMReserveRF                    (short                     refNum);
  179.  
  180. EXTERN_API( OSErr )
  181. CRMReleaseRF                    (short                     refNum);
  182.  
  183. #endif  /* CALL_NOT_IN_CARBON */
  184.  
  185.  
  186. #if PRAGMA_STRUCT_ALIGN
  187.     #pragma options align=reset
  188. #elif PRAGMA_STRUCT_PACKPUSH
  189.     #pragma pack(pop)
  190. #elif PRAGMA_STRUCT_PACK
  191.     #pragma pack()
  192. #endif
  193.  
  194. #ifdef PRAGMA_IMPORT_OFF
  195. #pragma import off
  196. #elif PRAGMA_IMPORT
  197. #pragma import reset
  198. #endif
  199.  
  200. #ifdef __cplusplus
  201. }
  202. #endif
  203.  
  204. #endif /* __COMMRESOURCES__ */
  205.  
  206.